import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/home/HomeView.vue'
import HomePageView from '../views/home/HomePageView.vue'
import HomeRankingView from '../views/home/HomeRankingView.vue'
import HomeClassificationView from '../views/home/HomeClassificationView.vue'
import HomeBoyView from '../views/home/HomeBoyView.vue'
import HomeGirlView from '../views/home/HomeGirlView.vue'
import BookshelfvView from '../views/Bookshelf/BookshelfvView.vue'
import DetailView from '@/views/detail/DetailView.vue'
import LookBookView from '@/views/LookBook/LookBookView.vue'
import SearchView from '@/views/search/SearchView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
      children: [
        {
          path: '',
          name: "page",
          component: HomePageView
        },
        {
          path: 'ranking',
          name: "ranking",
          component: HomeRankingView
        },
        {
          path: 'classification',
          name: "classification",
          component: HomeClassificationView
        },
        {
          path: 'boy',
          name: "boy",
          component: HomeBoyView
        },
        {
          path: 'girl',
          name: "girl",
          component: HomeGirlView
        },
      ]
    },
    {
      path: "/bookshelfv",
      name: "bookshelfv",
      component: BookshelfvView
    },
    {
      path: "/login",
      name: "login",
      component: () => import('@/views/login/LoginView.vue')
    },
    {
      path: "/register",
      name: "register",
      component: () => import('@/views/login/RegisterView.vue')
    },
    {
      path: "/setpass",
      name: "setpass",
      component: () => import('@/views/login/SetPassword.vue')
    },
    {
      path: "/personalCenter",
      name: "personalCenter",
      component: () => import('@/views/personalCenter/PersonalCenter.vue')
    },
    {
      path: "/voucherCenter",
      name: "voucherCenter",
      component: () => import('@/views/voucherCenter/VoucherCenterView.vue')
    },
    {
      path: "/topup/:value",
      name: "topup",
      component: () => import('@/views/voucherCenter/TopupView.vue')
    },
    {
      path: "/vip",
      name: "vip",
      component: () => import('@/views/vip/VipView.vue')
    },
    {
      path: "/changepassword",
      name: "changepassword",
      component: () => import('@/views/login/ChangePasswordView.vue')
    },
    {
      path: '/detail/:id',
      name: 'detail',
      component: DetailView
    },
    {
      path: '/catalogue/:id',
      name: 'catalogue',
      component: () => import('@/views/CatalogueView/CatalogueView.vue')
    },
    {
      path: '/lookBook/:id',
      name: 'lookBook',
      component: LookBookView
    },
    {
      path: '/search',
      name: 'search',
      component: SearchView
    },
  ]
})

export default router
